<% if @user && current_user == @user %>
<h2><%= t('.external_authors_for', :default => "External author identities for %{user}", :user => @user.login) %></h2>

  <p>
    <%= t('.external_authors_explanation', 
    :default => "If the owner of an archive where you previously kept your stories under a different email address moves or backs up that archive into the AO<sup>3</sup>, 
    you will be given control over those stories under that email address here.)") %>
  </p>

  <!--
  Adding/removing new external identities is coming soon 
    <ul class="navigation">
      <li><%= link_to t('.new_external_author', :default => 'New external author identity'), new_user_external_author_path(@user) %></li>
    </ul>
  -->
<% elsif current_user.archivist %>
<h2><%= t('.external_authors_unclaimed', :default => "External Authors Imported") %></h2>
<% end %>

<ul class="index">
  <% @external_authors.each do |external_author| %>
    <li>
      <h4>Identity: <%= external_author.external_author_names.collect(&:name).join(", ") %>
      </h4>
      <% if external_author.do_not_email %>
        <p><%= t('.do_not_email', :default => "No notifications will be sent to this email address." ) %></p>
      <% end %>

      <% if external_author.do_not_import %>
        <p><%= t('.do_not_import', :default => "Archivists may not import stories with this email." ) %></p>
      <% end %>
      
      <h4>Works:</h4>
        <ul class="work index">
        <% external_author.external_creatorships.each do |ext_creatorship| %>
        <li><%= link_to(ext_creatorship.creation.title, work_path(ext_creatorship.creation)) %></li>
        <% end %>
        </ul>
    
    
      <% if @user && current_user == @user %>
        <ul class="navigation">
          <li><%= link_to t('.edit_link', :default => 'Edit'), [:edit, @user, external_author] %></li>
          <!-- coming soon 
          <li>
            <%= link_to t('.delete_link', :default => 'Delete'), [@user, external_author], 
                          :confirm => t('.links.are_you_sure', :default => 'Are you sure?'), :method => :delete %>
          </li>
          -->
        </ul>
      <% end %>
    </li>
  <% end %>
</ul>

